﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcs.Web.partakeinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txtdpid.Text))
			{
				strErr+="计划编号格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtsid.Text))
			{
				strErr+="供应商编号格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtbidmoney.Text))
			{
				strErr+="中标价格格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtbond.Text))
			{
				strErr+="保证金格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtdocmoney.Text))
			{
				strErr+="标书费格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int dpid=int.Parse(this.txtdpid.Text);
			int sid=int.Parse(this.txtsid.Text);
			decimal bidmoney=decimal.Parse(this.txtbidmoney.Text);
			decimal bond=decimal.Parse(this.txtbond.Text);
			bool isbid=this.chkisbid.Checked;
			decimal docmoney=decimal.Parse(this.txtdocmoney.Text);
			bool isendbid=this.chkisendbid.Checked;

			lcs.Model.partakeinfo model=new lcs.Model.partakeinfo();
			model.dpid=dpid;
			model.sid=sid;
			model.bidmoney=bidmoney;
			model.bond=bond;
			model.isbid=isbid;
			model.docmoney=docmoney;
			model.isendbid=isendbid;

			lcs.BLL.partakeinfo bll=new lcs.BLL.partakeinfo();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
